(* condor config module for Augeas          *)

module CondorConfig =
   autoload xfm


   (* Define useful primitives *)
   let eol = Util.eol
   let empty = Util.empty
   let comment = Util.comment
   let eq = del /[ \t]*=[ \t]*/ " = "
   let colon = del /[ \t]*:[ \t]*/ " : "

   (* Defin key value pair *)
   let key_re = /[A-Za-z][A-Za-z0-9_.]*/
   let value = store /([^\n]*([\\][\n])?)*/
   let entry = [ key key_re . (eq | colon) . value . eol ]


   (* Define lens *)
   let lns = ( entry |  empty | comment)*

   let filter = incl "/etc/condor/condor_config"
              . Util.stdexcl

   let xfm = transform lns filter